#include "StdAfx.h"
#include "PSDFCore/Label/DotFontText.h"

DotFontText::DotFontText(const string& content, short fontIndex, double posX, double posY, double posZ, float r, float g, float b, int alignMode) :
	_content(content),
	_fontIndex(fontIndex),
	_posX(posX),
	_posY(posY),
	_posZ(posZ),
	_r(r),
	_g(g),
	_b(b),
	_alignMode(alignMode)
{
}

osg::Object* DotFontText::cloneType() const
{
	return NULL;
}

osg::Object* DotFontText::clone( const CopyOp& ) const
{
	return NULL;
}

osg::BoundingBox DotFontText::computeBound() const
 {
	BoundingBox box;
	box.set(_posX, _posY, _posZ, _posX+50, _posY+30, _posZ+1);
	return box;
}

void DotFontText::drawImplementation( RenderInfo& renderInfo ) const
{
	CVertex3D vertex;
	vertex.x = _posX;
	vertex.y = _posY;
	vertex.z = _posZ;

	SimpleString str(_content.c_str());

	glColor3f(_r, _g, _b);

	SceneCenter::inst()->DrawTextInfo(vertex, str, _alignMode, _fontIndex);
}


